<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="/admin/include/css/table.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/admin/include/organization/organizationJs.js"></script>
	</head>

	<body>
		<form>
			<input type="hidden" name="organizationId" value="${param.organizationId}" />
			<table id="listtable" cellspacing="0">
				<tr>
					<td class="toolbar" colspan="8">
						<input type="button" value="添加用户" class="add_button"
							onclick="window.location.href='/admin/include/organization/userAdd.seam?organizationId=${param.organizationId}'" />
						<input type="button" value="编辑用户" class="edit_button"
							onclick="editUser()" />
						<input type="button" value="删除用户" class="delete_button"
							onclick="deleteUser()" />
						<select name="newOrganizationId" onchange="javascript:changeOrganization()">
							<option value="">调整选择用户的所属机构...</option>
							${selectHtml}
						</select>
					</td>
				</tr>
				<tr>
					<th width="2%">
						<input type="checkbox" name="checkAll" onclick="checkedAll(this)" />
					</th>
					<th width="3%">
						#
					</th>
					<th width="8%">
						照片
					</th>
					<th width="27%">
						登录信息
					</th>
					<th width="20%">
						基本资料
					</th>
					<th width="25%">
						联系方式
					</th>
					<th width="7%">
						状态
					</th>
					<th width="8%">
						设置权限
					</th>
				</tr>
				<c:forEach items="${pageResult.resultList}" var="data"
					varStatus="lineInfo">
					<tr>
						<td class="t${lineInfo.count % 2}">
							<input type="checkbox" name="userIds" value="${data.userId}" />&nbsp;
						</td>
						<td class="t${lineInfo.count % 2}">
							${lineInfo.count}&nbsp;
						</td>
						<td class="t${lineInfo.count % 2}">
							<img src="/admin/include/upload/<c:out value="${data.photoUrl}"/>" onerror="javascript:this.src='/admin/include/images/photo_small_<c:out value="${data.gender}"/>.jpg'" width="45" height="50"/>
						</td>
						<td class="t${lineInfo.count % 2}">
							登 录 名：<c:out value="${data.loginName}" /><br/>
							登录密码：****** <a href="javascript:resetUserPassword('${data.userId}')">重置</a><br/>
							创建时间：<fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${data.createTime}"/><br/>
							最后登录：<fmt:formatDate pattern="yyyy-MM-dd HH:mm:ss" value="${data.lastLoginTime}"/><br/>
							登录次数：<c:out value="${data.loginNum}" />
						</td>
						<td class="t${lineInfo.count % 2}">
							真实姓名：<c:out value="${data.realName}" /><br/>
							用户性别：<c:out value="${data.genderName}" /><br/>
							所任职务：<c:out value="${data.position}" /><br/>
							最高学历：<c:out value="${data.education}" />
						</td>
						<td class="t${lineInfo.count % 2}">
							联系电话：<c:out value="${data.phone}" /><br/>
							手机号码：<c:out value="${data.mobilePhone}" /><br/>
							邮箱地址：<c:out value="${data.email}" />
						</td>
						<td class="t${lineInfo.count % 2}">
							<c:out value="${data.statusName}" /><br />
							<c:if test="${data.status eq '0'}"><a href="javascript:lockUser('${data.userId}')">锁定</a></c:if>
							<c:if test="${data.status eq '1'}"><a href="javascript:unlockUser('${data.userId}')">解锁</a></c:if>
						</td>
						<td class="t${lineInfo.count % 2}">
							<a href="permissionSet.seam?userId=${data.userId}&organizationId=${param.organizationId}">设置权限</a>
						</td>
					</tr>
				</c:forEach>
				<tr>
					<td class="page" colspan="8">
						<jsp:include page="/admin/include/page.jsp" />
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>

